//
//  TingOneTableViewCell.m
//  项目
//
//  Created by 张诗雨 on 14/12/30.
//  Copyright (c) 2014年 张诗雨. All rights reserved.
//

#import "TingOneTableViewCell.h"
#import "WebColor.h"
@implementation TingOneTableViewCell

- (void)dealloc
{
    [_backImg release];
    [_titleLable release];
    [_nameLable release];
    [_typeLable release];
    [_imgView release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [WebColor whiteSmoke];
        self.typeLable = [[UILabel alloc] initWithFrame:CGRectMake(20, 0, 100, 20)];
        self.typeLable.textColor = [WebColor steelBlue];
        self.typeLable.font = [UIFont systemFontOfSize:15.0f];
        [self.contentView addSubview:self.typeLable];
        [_typeLable release];
        
        self.imgView = [[UIImageView alloc] init];
        self.imgView.image = [UIImage imageNamed:@"bg_share_large.png"];
        [self.contentView addSubview:self.imgView];
        [_imgView release];
        
        self.backImg = [[UIImageView alloc] init];
        self.backImg.backgroundColor = [WebColor tan];
        [self.imgView addSubview:self.backImg];
        [_backImg release];
        
        self.titleLable = [[UILabel alloc] init];
        self.titleLable.font = [UIFont boldSystemFontOfSize:17.0f];
        [self.imgView addSubview:self.titleLable];
        [self.titleLable release];
        
        self.nameLable = [[UILabel alloc] init];
        self.nameLable.font = [UIFont systemFontOfSize:15.0f];
        self.nameLable.textColor = [WebColor silver];
        self.nameLable.textAlignment = NSTextAlignmentRight;
        [self.imgView addSubview:self.nameLable];
        [self.nameLable release];
        
        
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imgView.frame = CGRectMake(10, 25, self.frame.size.width - 20, self.frame.size.height - 35);
    self.backImg.frame = CGRectMake(0, 0, self.imgView.frame.size.width, (self.frame.size.height - 35) * 4 / 5);
    self.titleLable.frame = CGRectMake(10, (self.frame.size.height - 35) * 4 / 5, self.frame.size.width * 3 / 5, (self.frame.size.height - 35) / 5);
    self.nameLable.frame = CGRectMake(self.frame.size.width * 3 / 5 + 20, (self.frame.size.height - 35) * 4 / 5, self.frame.size.width/ 5, (self.frame.size.height - 35) / 5);
}
@end
